<script>
    function trash() {
        if (window.confirm("确认删除所有评论?")) {
            $.ajax({
                url: "/{{Route::current()->uri}}/trash",
                success: function (data) {
                    $.pjax.reload('#pjax-container');
                    toastr.success(data.message);
                },
                error: function () {
                    toastr.error('请求失败，请稍后再试');
                }
            });
        }
    }
</script>